var xmlHttp;
var base_url=window.location.protocol+"//"+window.location.host;

function createXMLHttpRequest() {
    if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  	xmlHttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	 	 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }

	  if (xmlHttp==null)
	  {
	  	alert ("Browser does not support Ajax HTTP Request");
		return;
	  }
}


function acceptRequest(booking_id){
//    alert(booking_id);
        createXMLHttpRequest();
        xmlHttp.onreadystatechange =  handleStateChangeForAcceptResquest;
        xmlHttp.open("POST",base_url+"/ajx-accept-booking/"+booking_id,true);
	xmlHttp.send(null);

}

function handleStateChangeForAcceptResquest() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
			response = xmlHttp.responseText;
			alert(response);
        }
    }
}